package com.zusmart.test.service.impl;

import com.zusmart.base.logging.Logger;
import com.zusmart.base.logging.LoggerFactory;
import com.zusmart.core.bean.annotation.Component;
import com.zusmart.core.bean.annotation.Destory;
import com.zusmart.core.bean.annotation.Initial;
import com.zusmart.core.bean.annotation.Order;
import com.zusmart.test.service.IMemberService;

@Component
public class InitialMemberServiceImpl implements IMemberService {

	private static final Logger logger = LoggerFactory.getLogger(InitialMemberServiceImpl.class);

	@Override
	public String getName(String id) {
		logger.debug("get name 处理成功 -> {}", id);
		return id;
	}

	@Override
	public boolean addName(String name) {
		logger.debug("add name 处理成功 -> {}", name);
		return true;
	}

	// 未加Order注解,按照查找顺序依次执行
	@Initial
	public void initialA() {
		System.out.println("initial a");
	}

	@Initial
	public void initialB() {
		System.out.println("initial b");
	}

	@Initial
	public void initialC() {
		System.out.println("initial c");
	}

	@Initial
	@Order(1) // 第二执行
	public void initialD() {
		System.out.println("initial d");
	}

	@Initial
	@Order(0) // 最先执行
	public void initialE() {
		System.out.println("initial e");
	}

	// 未加Order注解,按照查找顺序依次执行
	@Destory
	public void destoryA() {
		System.out.println("destory a");
	}

	@Destory
	public void destoryB() {
		System.out.println("destory b");
	}

	@Destory
	public void destoryC() {
		System.out.println("destory c");
	}

	@Destory
	@Order(1) // 第二执行
	public void destoryD() {
		System.out.println("destory d");
	}

	@Destory
	@Order(0) // 最先执行
	public void destoryE() {
		System.out.println("destory e");
	}

}